package com.link.cloud.config.mybatis;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 用于扫描mybatis的mapper接口类
 * @author maxiaob
 *
 */
@Configuration
//注意，由于MapperScannerConfigurer执行的比较早，所以必须有下面的注解
@AutoConfigureAfter(MybatisMapperScannerConfig.class)
public class MybatisMapperScannerConfig {
	
	@Bean
    public MapperScannerConfigurer mapperScannerConfigurer() {
        MapperScannerConfigurer conf = new MapperScannerConfigurer();
        conf.setBasePackage("com.link.cloud.business.**.repository");
        //conf.setAnnotationClass(PlatformRepository.class);
        conf.setSqlSessionFactoryBeanName("sqlSessionFactory");
        return conf;
    }

}
